var nmap = require('libnmap')
  , opts = {
      range: [
        '192.168.10.170/24',
        '127.0.0.1'
      ]
    };

nmap.scan(opts, function(err, report) {

  if (err) throw new Error(err);

  for (var item in report) {
    console.log(JSON.stringify(report[item], null, 2));
  }
  //console.log("before process.exit()");
  //process.exit();
});
